package top.drinyeit.nongmao.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.scu.miomin.shswiperefresh.core.SHSwipeRefreshLayout;

import top.drinyeit.nongmao.R;
import top.drinyeit.nongmao.base.BaseActivity;
import top.drinyeit.nongmao.databinding.ChildOrderView;
import top.drinyeit.nongmao.viewmodel.ChildOrderVM;

/**
 * Created by YJY on 2018/1/13.
 *
 * @param "parent_order_id" String
 */

public class ChildOrderActivity extends BaseActivity {

    ChildOrderView mChildOrderView;
    public SHSwipeRefreshLayout shSwipeRefreshLayout;
    public RecyclerView childOrderList;
    public ImageView back;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mChildOrderView = DataBindingUtil.setContentView(this, R.layout.activity_order_child);
        initList();
        back = findViewById(R.id.iv_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        setTitle(true,"订单详情");
        mChildOrderView.setIChildOrderView(new ChildOrderVM(this));
    }

    private void initList() {
        shSwipeRefreshLayout = (SHSwipeRefreshLayout) findViewById(R.id.srl_childOrder);
        childOrderList = (RecyclerView) findViewById(R.id.list_childOrder);
        childOrderList.setLayoutManager(new LinearLayoutManager(this));
        childOrderList.setHasFixedSize(true);
    }
}
